package com.liugh.entity.standard;


import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;

/**
 *Created by Fatao on 2018/9/27
 * page表,存储标准的详情
 */

@Builder
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@ToString
@TableName("standard_page")
public class StandardPage extends Model<StandardPage> {

     private static final long serialVersionUID = 1L;

     @TableId(value = "id", type = IdType.AUTO)
     private   int id;

     /**
      * 对应standardItem表的ID
      */
     @TableField("standard_item_id")
     private   int standardItemId;

     /**
      * 碎片化以后当前页所在页码的编号
      */
     @TableField("page_order")
     private   int pageOrder;

     /**
      * 标准名称
      */
     @TableField("stand_name")
     private String standName;

     /**
      * 碎片化以后每页图片的存储URL
      */
     @TableField("page_dir")
     private  String pageDir;

     @TableField(exist = false)
     private StandardItem item;

     @Override
     protected Serializable pkVal() {
          return this.id;
     }

     public StandardPage(int itemId,int order, String standName,String pageDir) {
          this.pageDir = pageDir;
          this.pageOrder = order;
          this.standName = standName;
          this.standardItemId = itemId;
     }

}
